<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>PyScript Offline</title>
  <link rel="icon" type="image/png" href="/single-logo.png" />
  <script type="module" src="/pyscript/dist/core.js"></script>
  <link rel="stylesheet" href="/pyscript/dist/core.css">
</head>
<body>
    <!-- 3.4.0 -->
    <div style="border-radius: 8px;background-color: white;">
        <script type="mpy-editor">
            import sys
            print(sys.version)
            a = 42
            print(a)
        </script>    
    </div>
    <!-- 3.12.1 -->
    <script type="py-editor"  env="shared">
        n = 10**8  # 代求的范围中的最大值
        k = 0
        s = [True for i in range(n)]  # 首先默认所有数都是质数
        z = []
        for i in range(2,n):
            if s[i]:  # 判断是否为质数，如果没有被标记过，就是质数
                k+=1
                print(i) # 质数
                for j in range(i+i,n,i):   # 将是指数的倍数的数都改为False
                    s[j] = False

        print(k) # 个数
    </script>
    
</body>
</html>
<style>
    .mpy-editor-output{
        width: 200px;
        word-wrap:break-word; 
        white-space:normal;
        word-break:break-all;    
        overflow:hidden;     
    }
</style>
